package com.bw.day03.quan

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.viewModelScope
import com.bw.base.net.entity.MyQuanEntity
import com.bw.base.net.entity.Res
import com.bw.base.net.entity.UserEntity
import com.bw.base.net.mvvm.BaseViewModel
import kotlinx.coroutines.launch
import retrofit2.http.Query

class QuanViewModel: BaseViewModel() {
    var useSuccess= MutableLiveData<Res< MyQuanEntity>>()
    var useFail= MutableLiveData<String>()
    fun use(limit:String,page:String,type:String){
        viewModelScope.launch {
            try {
                useSuccess.value=apiService.myQuan(limit,page,type)
            }catch (e:Exception){
                useFail.value=e.message
            }
        }
    }
}